<nz-breadcrumb class="breadcrumb">
  <nz-breadcrumb-item>
    <a routerLink="/Home">首页</a>
  </nz-breadcrumb-item>
  <nz-breadcrumb-item>应聘申请列表</nz-breadcrumb-item>
</nz-breadcrumb>
<form nz-form class="search-form" [formGroup]="searchForm" (keydown.enter)="$event.preventDefault();onSearch()" nzLayout="inline">
  <nz-form-item>
    <nz-form-label nzFor="enterpriseName">企业名称</nz-form-label>
    <nz-form-control>
      <nz-input-group nzSearch [nzAddOnAfter]="enterpriseNameSuffixIconButton">
        <input nz-input formControlName="enterpriseName" placeholder="请选择企业名称" readonly />
      </nz-input-group>
      <ng-template #enterpriseNameSuffixIconButton>
        <button nz-button nzType="primary" nzSearch (click)="findEnterprise()"><nz-icon nzType="search" /></button>
      </ng-template>
    </nz-form-control>
  </nz-form-item>
  <nz-form-item>
    <nz-form-label nzFor="jobDescriptionName">招聘岗位名称</nz-form-label>
    <nz-form-control>
      <nz-input-group nzSearch [nzAddOnAfter]="jobDescriptionNameSuffixIconButton">
        <input nz-input formControlName="jobDescriptionName" placeholder="请选择招聘岗位名称" readonly />
      </nz-input-group>
      <ng-template #jobDescriptionNameSuffixIconButton>
        <button nz-button nzType="primary" nzSearch (click)="findJobDescription()"><nz-icon nzType="search" /></button>
      </ng-template>
    </nz-form-control>
  </nz-form-item>
  <nz-form-item>
    <nz-form-label nzFor="candidateName">应聘者姓名</nz-form-label>
    <nz-form-control>
      <nz-input-group nzSearch [nzAddOnAfter]="candidateNameSuffixIconButton">
        <input nz-input formControlName="candidateName" placeholder="请选择应聘者姓名" readonly />
      </nz-input-group>
      <ng-template #candidateNameSuffixIconButton>
        <button nz-button nzType="primary" nzSearch (click)="findCandidate()" [disabled]="disableFindCandidateFormItem"><nz-icon nzType="search" /></button>
      </ng-template>
    </nz-form-control>
  </nz-form-item>
  <nz-form-item>
    <nz-form-label nzFor="status">状态</nz-form-label>
    <nz-form-control>
      <nz-select formControlName="status" class="custom-select-width">
        <nz-option nzLabel="申请" [nzValue]="10"></nz-option>
        <nz-option nzLabel="面试邀约" [nzValue]="20"></nz-option>
        <nz-option nzLabel="录用" [nzValue]="30"></nz-option>
        <nz-option nzLabel="拒绝" [nzValue]="90"></nz-option>
      </nz-select>
    </nz-form-control>
  </nz-form-item>
  <button nz-button type="button" nzType="primary" [nzLoading]="searchLoading" (click)="onSearch()">查询</button>
  <button nz-button type="button" class="margin-button" (click)="onReset()">重置</button>
  <button nz-button type="button" class="margin-button" nzType="primary" (click)="onAdd()">新增</button>
</form>
<nz-table #basicTable [nzData]="listOfData" [nzTotal]="total" [nzLoading]="searchLoading" nzSize="small">
  <thead>
    <tr>
      <th>企业名称</th>
      <th>招聘岗位名称</th>
      <th>应聘者姓名</th>
      <th>状态</th>
      <th nzWidth="350px">操作</th>
    </tr>
  </thead>
  <tbody>
    <tr *ngFor="let data of basicTable.data">
      <td>{{data.enterpriseName}}</td>
      <td>{{data.jobDescriptionName}}</td>
      <td>{{data.candidateName}}</td>
      <td>
        <ng-container *ngIf="data.status === 10">申请</ng-container>
        <ng-container *ngIf="data.status === 20">面试邀约</ng-container>
        <ng-container *ngIf="data.status === 30">录用</ng-container>
        <ng-container *ngIf="data.status === 90">拒绝</ng-container>
      </td>
      <td>
        <button nz-button type="button" nzType="primary" (click)="editRow(data.id)">编辑</button>
        <button nz-button type="button" nzDanger class="margin-button" (click)="delRow(data.id)">删除</button>
        <button nz-button type="button" class="margin-button" (click)="detailRow(data)">详情</button>
        <button nz-button type="button" class="margin-button" (click)="candidateRow(data)">应聘者详情</button>
      </td>
    </tr>
  </tbody>
</nz-table>
<enterprise-selector (enterpriseSelectedEvent)="handleEnterpriseSelectedEvent($event)"></enterprise-selector>
<job-description-selector (jobDescriptionSelectedEvent)="handleJobDescriptionSelectedEvent($event)"></job-description-selector>
<candidate-selector (candidateSelectedEvent)="handleCandidateSelectedEvent($event)"></candidate-selector>
<application-record-add (addedEvent)="onAdded($event)"></application-record-add>
<application-record-view></application-record-view>
<candidate-view-all></candidate-view-all>
